-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lodash: Refactor flat term selection away from _.unescape()
#47572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works as expected. Thanks, @tyxla!
Size Change: -21 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 9c2d853. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4046041735
|
What?
This PR removes Lodash's
_.unescape()
from the flat term selection interface. There is just a single use in that component and conversion is pretty straightforward.Similar to #47561.
Why?
Lodash is known to unnecessarily inflate the bundle size of packages, and in most cases, it can be replaced with native language functionality. See these for more information and rationale:
@wordpress/api-fetch
package haslodash
as a dependency #39495How?
We're replacing
_.unescape()
withdecodeEntities()
from@wordpress/html-entities
.This allows us to simplify the code because
decodeEntities()
will decode'
while Lodash's_.unescape()
won't.Testing Instructions
/wp-admin/edit-tags.php?taxonomy=post_tag
test >'< test
.test >'< test
will be created.
is replaced with a regular space.test >'< test
.